<?php

namespace app\api\controller;

use app\api\model\UserConsumeLog;
use app\common\controller\Api;


/**
 * 会员消费接口
 */
class Userconsume extends Api
{
    protected $noNeedRight = '*';


    //我的消费
    public function lists()
    {
        $status = input('status',0);//0已付款,1退款/售后
        $consume_log_model = new UserConsumeLog();
        $lists = $consume_log_model->lists($this->auth->id,$status);
        $this->success('',$lists);
    }


    //推广订单
    public function extendorder()
    {
        $status = input('status',0);//0已付款,1退款/售后
        $keyword = input('keyword','');
        $consume_log_model = new UserConsumeLog();
        $lists = $consume_log_model->extendorder($this->auth->id,$status,$keyword);
        $this->success('',$lists);
    }

    //收益数据
    public function consumestat()
    {
        $param = input();
        $consume_log_model = new UserConsumeLog();
        $param['user_id'] = $this->auth->id;
        $res = $consume_log_model->stat($param);
        $this->success('',$res);
    }
}